package com.chinasi.dao.impl;

import java.util.List;

import org.apache.ibatis.session.RowBounds;

import com.chinasi.dao.BidConsultDao;
import com.chinasi.model.BidConsult;
import com.chinasi.model.BidConsumer;
import com.chinasi.model.ConsultBasic;
import com.chinasi.model.ConsumerBasic;
import com.chinasi.model.mvo.BidAgencyMvo;
import com.chinasi.model.mvo.BidConsultMvo;
import com.chinasi.model.mvo.BidConsumerMvo;
import com.chinasi.model.mvo.BidExpertMvo;
import com.chinasi.model.mvo.BidIntegrationMvo;
import com.chinasi.model.mvo.BidSupvisionMvo;
import com.caland.framework.core.annotation.Dao;
import com.caland.framework.core.page.Pager;
import com.caland.framework.dao.ibatis.impl.MyBatisBaseDaoImpl;

@Dao
public class BidConsultDaoImpl extends MyBatisBaseDaoImpl<BidConsult, java.lang.String> implements BidConsultDao {

	private static final String SQL_PREFIX = "com.chinasi.model.BidConsult.";
	@Override
	public List<BidConsultMvo> findRelationBid(BidConsult searchBean,
			Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationBid", searchBean, rowBounds);
	}
	@Override
	public int getRelationConsumerTotalCount(ConsultBasic consult) {
		return this.getCurSqlSessionTemplate().selectOne(SQL_PREFIX + "getRelationConsumerTotalCount", consult);
	}
	@Override
	public List<BidConsumerMvo> findRelationConsumer(ConsultBasic consult,
			Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationConsumer", consult, rowBounds);
	}
	@Override
	public int getRelationIntegratorTotalCount(ConsultBasic consult) {
		return this.getCurSqlSessionTemplate().selectOne(SQL_PREFIX + "getRelationIntegratorTotalCount", consult);
	}
	@Override
	public List<BidIntegrationMvo> findRelationIntegrator(
			ConsultBasic consult, Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationIntegrator", consult, rowBounds);
	}
	@Override
	public int getRelationAgencyTotalCount(ConsultBasic consult) {
		return this.getCurSqlSessionTemplate().selectOne(SQL_PREFIX + "getRelationAgencyTotalCount", consult);
	}
	@Override
	public List<BidAgencyMvo> findRelationAgency(ConsultBasic consult,
			Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationAgency", consult, rowBounds);
	}
	@Override
	public int getRelationSupervisionTotalCount(ConsultBasic consult) {
		return this.getCurSqlSessionTemplate().selectOne(SQL_PREFIX + "getRelationSupervisionTotalCount", consult);
	}
	@Override
	public List<BidSupvisionMvo> findRelationSupervision(
			ConsultBasic consult, Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationSupervision", consult, rowBounds);
	}
	@Override
	public int getRelationExpertTotalCount(ConsultBasic consult) {
		return this.getCurSqlSessionTemplate().selectOne(SQL_PREFIX + "getRelationExpertTotalCount", consult);
	}
	@Override
	public List<BidExpertMvo> findRelationExpert(ConsultBasic consult,
			Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationExpert", consult, rowBounds);
	}
}
